package com.miplus.ccrm.core.service.crd;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.miplus.ccrm.core.controller.vo.LabelResVo;
import com.miplus.ccrm.core.pojo.FiCreditcaseGrpTag;
import com.miplus.ccrm.core.service.crd.FiCreditcaseGrpTagService;
import com.miplus.ccrm.core.mapper.FiCreditcaseGrpTagMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author wangzl
* @description 针对表【fi_creditcase_grp_tag】的数据库操作Service实现
* @createDate 2024-11-08 13:05:15
*/
@Service
public class FiCreditcaseGrpTagServiceImpl extends MPJBaseServiceImpl<FiCreditcaseGrpTagMapper, FiCreditcaseGrpTag>
    implements FiCreditcaseGrpTagService{
    @Override
    public void deleteCollectGrpTag(String sql, String tag) {
        baseMapper.deleteCollectGrpTag(sql,tag);
    }

    @Override
    public void addCollectGrpTag(String sql, String tag)
    {
        baseMapper.addCollectGrpTag(sql, tag);
    }

    @Override
    public List<LabelResVo> getCaseGrpTagList() {

        return selectJoinList(LabelResVo.class, new MPJLambdaWrapper<>(FiCreditcaseGrpTag.class)
                .selectAs(FiCreditcaseGrpTag::getGrpTag,LabelResVo::getLabel)
                .selectAs(FiCreditcaseGrpTag::getGrpTag,LabelResVo::getValue)
                .groupBy(FiCreditcaseGrpTag::getGrpTag)
        );
    }
}




